<?php
header("Cache-Control: no-cache");
require_once "funciones.php";
?>

<html>
<head>
    <link rel="stylesheet" type="text/css" media="screen" href="css/caweb.css" />
<script src="caweb.js"></script>
<script type="text/javascript" src="jquery.js"></script>

</head>
<body>

<center><h2>Consulta de Inventarios de Partes</h2></center>
<center><b><h4><font color="blue"> ** NO incluye Bodega BAJAS ** </font></h4></b></center>
<hr />
<br /><br /><br />

<form action="datagridinventariosp/consultainventario2p.php" method="post" name="consultainventarios" id="consultainventarios">

<?php
$link_caweb = con_caweb();
$result ="select scla.codigosubclases,scla.descripcionsubclase from intranetpccom.taxonomia tax
            inner join intranetpccom.subclases scla on tax.codigosubclases = scla.codigosubclases and scla.estado = 1
            where tax.porcantidad <> 'Si' and tax.estado = 1 and scla.codigoclase = 'P'
            group by codigosubclases order by descripcionsubclase";
$result =mysql_query($result,$link_caweb) or die('Error Subclase, '.mysql_error());

echo "SubClase de Parte: <select name='claseitem' id='claseitem' size='1' class='mayusculas'>";
echo "<option value='XXX'>Todos</option>";
while($row = mysql_fetch_array($result))
{
echo "<option value='".$row['codigosubclases']."'>".$row['descripcionsubclase']."</option>";
}
echo "</select>";

?>
<br />
<br />
<table border="1"><tr><td>
<input type="radio" name="tipobusqueda" value="ITEM"        onclick="$('#layer2_itemsp').load('layer2_itemsp.php',{q:this.value});" /> Item
<input type="radio" name="tipobusqueda" value="EMPIEZA"     onclick="$('#layer2_itemsp').load('layer2_itemsp.php',{q:this.value});" /> Empieza por
<input type="radio" name="tipobusqueda" value="CONTIENE"    onclick="$('#layer2_itemsp').load('layer2_itemsp.php',{q:this.value});" /> Contiene
<input type='radio' name='tipobusqueda' value="NOCONTIENE"  onclick="$('#layer2_itemsp').load('layer2_itemsp.php',{q:this.value});"/> No Contiene
       
<div id="layer2_itemsp"></div>
</tr></td>
</table>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Operador 
<select name="operador" size="1" id="operador">
<option value="AND" selected="">Y</option>
<option value="OR">O</option>
</select>
<br /><br />

<table border="1"><tr><td>
<input type='radio' name='tipobusqueda2' value="ITEM"        onclick="$('#layer22_itemsp').load('layer22_itemsp.php',{q:this.value});"/> Item
<input type='radio' name='tipobusqueda2' value="EMPIEZA"     onclick="$('#layer22_itemsp').load('layer22_itemsp.php',{q:this.value});"/> Empieza por
<input type='radio' name='tipobusqueda2' value="CONTIENE"    onclick="$('#layer22_itemsp').load('layer22_itemsp.php',{q:this.value});"/> Contiene
<input type='radio' name='tipobusqueda2' value="NOCONTIENE"  onclick="$('#layer22_itemsp').load('layer22_itemsp.php',{q:this.value});"/> No Contiene

<div id="layer22_itemsp"></div>
</tr></td>
</table>

<br />
<br />

<?php 
    $result2 ="SELECT codigosucursal,nombre FROM sucursales";
    $result2 =mysql_query($result2,$link_caweb) or die('Error sucursales, '.mysql_error());
    echo "Sucursal: <select name='sucursal' size='1'>";
    echo "<option value='XXX' SELECTED>Seleccionar..</option>";
    while($row2 = mysql_fetch_array($result2))
    {
		echo "<option value='".$row2[codigosucursal]."'>".$row2[codigosucursal]." -> ".$row2[nombre]."</option>";
    }
    echo "</select>";
    ?>
    
    <br />
    <br />
    <table border="0"><tr><td>
    Bodega: <select name="bodega" size="1" id="combobodega" onchange="$('#layer1_ubicacionesp').load('layer1_ubicacionesp.php',{q:this.value});">
    <?
    $link_caweb = con_caweb();
    $result ="SELECT codigobodega,nombre FROM bodegas WHERE codigobodega<>'BAJ' AND codigobodega<>'TER' ";
    $result=mysql_query($result,$link_caweb) or die('Error bodegas, '.mysql_error());
    echo "<option value='XXX' SELECTED>Seleccionar..</option>";
    while($row = mysql_fetch_array($result))
    {
        ?>  <option value="<? echo $row["codigobodega"]; ?>"><? echo $row["codigobodega"]." - ".$row["nombre"]; ?> </option>   <?
    }
    echo "</select>";
    ?>

<td>
<div id="layer1_ubicacionesp"></div>
</tr></td>
</table>

Excluir: <select name="bodegaexcluida1" size="1" id="bodegaexcluida1">
<?
$link_caweb = con_caweb();
$result ="SELECT codigobodega,nombre FROM bodegas WHERE codigobodega<>'BAJ' AND codigobodega<>'TER' ";
$result=mysql_query($result,$link_caweb) or die('Error bodegas, '.mysql_error());
echo "<option value='XXX' SELECTED>Seleccionar..</option>";
while($row = mysql_fetch_array($result))
{
    ?>  <option value="<? echo $row["codigobodega"]; ?>"><? echo $row["codigobodega"]." - ".$row["nombre"]; ?> </option>   <?
}
echo "</select>";
?>

<br />Excluir: <select name="bodegaexcluida2" size="1" id="bodegaexcluida2">
<?
$link_caweb = con_caweb();
$result ="SELECT codigobodega,nombre FROM bodegas WHERE codigobodega<>'BAJ' AND codigobodega<>'TER' ";
$result=mysql_query($result,$link_caweb) or die('Error bodegas, '.mysql_error());
echo "<option value='XXX' SELECTED>Seleccionar..</option>";
while($row = mysql_fetch_array($result))
{
    ?>  <option value="<? echo $row["codigobodega"]; ?>"><? echo $row["codigobodega"]." - ".$row["nombre"]; ?> </option>   <?
}
echo "</select>";
?>

<br />Excluir: <select name="bodegaexcluida3" size="1" id="bodegaexcluida3">
<?
$link_caweb = con_caweb();
$result ="SELECT codigobodega,nombre FROM bodegas WHERE codigobodega<>'BAJ' AND codigobodega<>'TER' ";
$result=mysql_query($result,$link_caweb) or die('Error bodegas, '.mysql_error());
echo "<option value='XXX' SELECTED>Seleccionar..</option>";
while($row = mysql_fetch_array($result))
{
    ?>  <option value="<? echo $row["codigobodega"]; ?>"><? echo $row["codigobodega"]." - ".$row["nombre"]; ?> </option>   <?
}
echo "</select>";
?>

<br />
<br />
Calidad:
<select name="calidad" size="1" id="comboestado">
<option value="XXX">Todos</option>
<option value="C">Conforme</option>
<option value="NC">No Conforme</option>
<option value="NCD">No conforme definitivo</option>
</select>

<br />
Estado:
<select name="estado" size="1" id="combolisto">
<option value="XXX">Todos</option>
<option value="V">Vigente</option>
<option value="D">Disponible</option>
<option value="A">Asignado</option>
<option value="B">Baja</option>
</select>


<br />
Tipo de Reporte:
<select name="tiporeporte" size="1" id="combotiporeporte">
<option value="D">Detallado</option>
<option value="R" selected="">Resumido</option>
</select>

<br />
<br />
<input type="hidden" name="ubicacion" value="" />
<input type="hidden" name="busqueda" value="" />
<input type="hidden" name="busqueda2" value=""/>
<input type="hidden" name="primeravez" value="1" />
<input type="submit" id="Button1" name="Submit" value="Consultar" />
</form>




</body>
</html>
